"""
可以使用
WMIC /NAMESPACE:\\root\
wmi PATH WmiMonitorBrightnessMethods WHERE "Active=TRUE" CALLWmiSetBrightnessBrightness=XXX Timeout=0
这条指令来调整亮度，对应的xxx就是亮度的百分比
"\\" = "\"
"""

import os
import sys
import time

flag = True
while flag:
    instract1 = "WMIC /NAMESPACE:\\\\root\\wmi PATH WmiMonitorBrightnessMethods WHERE \"Active=TRUE\" CALL WmiSetBrightness Brightness="
    instract2 = "Timeout=0"

    print("输入要调整的亮度 0 ~ 100")
    Light_per = input("")
    instract1 = instract1 + Light_per
    instract = instract1 + " " + instract2

    os.system(instract)
    print("执行成功")
    isOut = input("输入0退出程序")
    if isOut == "0":
        flag = False
print("程序退出")
time.sleep(0.5)


